package com.grass.appointment.databinding;

import android.graphics.drawable.Drawable;
import android.support.p007v4.media.session.PlaybackStateCompat;
import android.util.SparseIntArray;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.databinding.DataBindingComponent;
import androidx.databinding.ViewDataBinding;
import androidx.databinding.adapters.ImageViewBindingAdapter;
import androidx.databinding.adapters.TextViewBindingAdapter;
import com.androidx.p013lv.base.bean.UserInfo;
import com.androidx.p013lv.base.utils.UiUtils;
import com.grass.appointment.C2693BR;
import com.grass.appointment.C2694R;
import com.grass.appointment.activity.UserInfoActivity;
import com.grass.appointment.generated.callback.OnClickListener;
import com.youth.banner.Banner;

public class AppointmentUserDetailsBindingImpl extends AppointmentUserDetailsBinding implements OnClickListener.Listener {
    private static final ViewDataBinding.IncludedLayouts sIncludes = null;
    private static final SparseIntArray sViewsWithIds;
    private final View.OnClickListener mCallback1;
    private final View.OnClickListener mCallback2;
    private final View.OnClickListener mCallback3;
    private final View.OnClickListener mCallback4;
    private long mDirtyFlags;
    private final LinearLayout mboundView0;
    private final ImageView mboundView1;
    private final ImageView mboundView11;
    private final ImageView mboundView12;
    private final TextView mboundView2;
    private final ImageView mboundView3;
    private final ImageView mboundView4;
    private final TextView mboundView5;
    private final TextView mboundView6;
    private final LinearLayout mboundView7;
    private final TextView mboundView8;

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        sViewsWithIds = sparseIntArray;
        sparseIntArray.put(C2694R.C2697id.banner, 13);
    }

    public AppointmentUserDetailsBindingImpl(DataBindingComponent dataBindingComponent, View view) {
        this(dataBindingComponent, view, mapBindings(dataBindingComponent, view, 14, sIncludes, sViewsWithIds));
    }

    private AppointmentUserDetailsBindingImpl(DataBindingComponent dataBindingComponent, View view, Object[] objArr) {
        super(dataBindingComponent, view, 1, (Banner) objArr[13], (TextView) objArr[10], (TextView) objArr[9]);
        this.mDirtyFlags = -1;
        LinearLayout linearLayout = (LinearLayout) objArr[0];
        this.mboundView0 = linearLayout;
        linearLayout.setTag(null);
        ImageView imageView = (ImageView) objArr[1];
        this.mboundView1 = imageView;
        imageView.setTag(null);
        ImageView imageView2 = (ImageView) objArr[11];
        this.mboundView11 = imageView2;
        imageView2.setTag(null);
        ImageView imageView3 = (ImageView) objArr[12];
        this.mboundView12 = imageView3;
        imageView3.setTag(null);
        TextView textView = (TextView) objArr[2];
        this.mboundView2 = textView;
        textView.setTag(null);
        ImageView imageView4 = (ImageView) objArr[3];
        this.mboundView3 = imageView4;
        imageView4.setTag(null);
        ImageView imageView5 = (ImageView) objArr[4];
        this.mboundView4 = imageView5;
        imageView5.setTag(null);
        TextView textView2 = (TextView) objArr[5];
        this.mboundView5 = textView2;
        textView2.setTag(null);
        TextView textView3 = (TextView) objArr[6];
        this.mboundView6 = textView3;
        textView3.setTag(null);
        LinearLayout linearLayout2 = (LinearLayout) objArr[7];
        this.mboundView7 = linearLayout2;
        linearLayout2.setTag(null);
        TextView textView4 = (TextView) objArr[8];
        this.mboundView8 = textView4;
        textView4.setTag(null);
        this.tvMyFans.setTag(null);
        this.tvMyFollow.setTag(null);
        setRootTag(view);
        this.mCallback4 = new OnClickListener(this, 4);
        this.mCallback2 = new OnClickListener(this, 2);
        this.mCallback3 = new OnClickListener(this, 3);
        this.mCallback1 = new OnClickListener(this, 1);
        invalidateAll();
    }

    @Override // androidx.databinding.ViewDataBinding
    public void invalidateAll() {
        synchronized (this) {
            this.mDirtyFlags = 2048;
        }
        requestRebind();
    }

    @Override // androidx.databinding.ViewDataBinding
    public boolean hasPendingBindings() {
        synchronized (this) {
            if (this.mDirtyFlags != 0) {
                return true;
            }
            return false;
        }
    }

    @Override // androidx.databinding.ViewDataBinding
    public boolean setVariable(int i, Object obj) {
        if (C2693BR.userInfo == i) {
            setUserInfo((UserInfo) obj);
        } else if (C2693BR.click == i) {
            setClick((UserInfoActivity.OnClick) obj);
        } else if (C2693BR.isSelf != i) {
            return false;
        } else {
            setIsSelf((Boolean) obj);
        }
        return true;
    }

    @Override // com.grass.appointment.databinding.AppointmentUserDetailsBinding
    public void setUserInfo(UserInfo userInfo) {
        updateRegistration(0, userInfo);
        this.mUserInfo = userInfo;
        synchronized (this) {
            this.mDirtyFlags |= 1;
        }
        notifyPropertyChanged(C2693BR.userInfo);
        super.requestRebind();
    }

    @Override // com.grass.appointment.databinding.AppointmentUserDetailsBinding
    public void setClick(UserInfoActivity.OnClick onClick) {
        this.mClick = onClick;
        synchronized (this) {
            this.mDirtyFlags |= 2;
        }
        notifyPropertyChanged(C2693BR.click);
        super.requestRebind();
    }

    @Override // com.grass.appointment.databinding.AppointmentUserDetailsBinding
    public void setIsSelf(Boolean bool) {
        this.mIsSelf = bool;
        synchronized (this) {
            this.mDirtyFlags |= 4;
        }
        notifyPropertyChanged(C2693BR.isSelf);
        super.requestRebind();
    }

    /* access modifiers changed from: protected */
    @Override // androidx.databinding.ViewDataBinding
    public boolean onFieldChange(int i, Object obj, int i2) {
        if (i != 0) {
            return false;
        }
        return onChangeUserInfo((UserInfo) obj, i2);
    }

    private boolean onChangeUserInfo(UserInfo userInfo, int i) {
        if (i == C2693BR._all) {
            synchronized (this) {
                this.mDirtyFlags |= 1;
            }
            return true;
        } else if (i == C2693BR.nickName) {
            synchronized (this) {
                this.mDirtyFlags |= 8;
            }
            return true;
        } else if (i == C2693BR.gender) {
            synchronized (this) {
                this.mDirtyFlags |= 16;
            }
            return true;
        } else if (i == C2693BR.official) {
            synchronized (this) {
                this.mDirtyFlags |= 32;
            }
            return true;
        } else if (i == C2693BR.freeWatches) {
            synchronized (this) {
                this.mDirtyFlags |= 64;
            }
            return true;
        } else if (i == C2693BR.userId) {
            synchronized (this) {
                this.mDirtyFlags |= 128;
            }
            return true;
        } else if (i == C2693BR.f1798ua) {
            synchronized (this) {
                this.mDirtyFlags |= 256;
            }
            return true;
        } else if (i == C2693BR.f1795bu) {
            synchronized (this) {
                this.mDirtyFlags |= 512;
            }
            return true;
        } else if (i != C2693BR.attentionHe) {
            return false;
        } else {
            synchronized (this) {
                this.mDirtyFlags |= 1024;
            }
            return true;
        }
    }

    /* access modifiers changed from: protected */
    /* JADX WARNING: Removed duplicated region for block: B:70:0x00d5  */
    /* JADX WARNING: Removed duplicated region for block: B:74:0x00e2  */
    /* JADX WARNING: Removed duplicated region for block: B:77:0x00ea  */
    /* JADX WARNING: Removed duplicated region for block: B:81:0x00f8  */
    /* JADX WARNING: Removed duplicated region for block: B:84:0x0102  */
    /* JADX WARNING: Removed duplicated region for block: B:97:0x0124  */
    @Override // androidx.databinding.ViewDataBinding
    public void executeBindings() {
        long j;
        boolean z;
        String str;
        String str2;
        String str3;
        int i;
        Drawable drawable;
        int i2;
        String str4;
        int i3;
        int i4;
        int i5;
        long j2;
        long j3;
        String str5;
        String str6;
        long j4;
        boolean z2;
        int i6;
        boolean z3;
        synchronized (this) {
            j = this.mDirtyFlags;
            this.mDirtyFlags = 0;
        }
        UserInfo userInfo = this.mUserInfo;
        UserInfoActivity.OnClick onClick = this.mClick;
        Boolean bool = this.mIsSelf;
        int i7 = 8;
        String str7 = null;
        if ((4089 & j) != 0) {
            if ((j & 2177) != 0) {
                str4 = String.valueOf(userInfo != null ? userInfo.getUserId() : 0);
            } else {
                str4 = null;
            }
            i2 = ((j & 2065) == 0 || userInfo == null) ? 0 : userInfo.getGender();
            long j5 = j & 2057;
            boolean z4 = true;
            if (j5 != 0) {
                if (userInfo != null) {
                    str5 = userInfo.getNickName();
                } else {
                    str5 = null;
                }
                z = str5 == null;
                if (j5 != 0) {
                    j |= z ? 8192 : 4096;
                }
            } else {
                str5 = null;
                z = false;
            }
            long j6 = j & 3073;
            if (j6 != 0) {
                if (userInfo != null) {
                    z3 = userInfo.isAttentionHe();
                } else {
                    z3 = false;
                }
                if (j6 != 0) {
                    j |= z3 ? 8388608 : 4194304;
                }
                drawable = getDrawableFromResource(this.mboundView12, z3 ? C2694R.C2696drawable.appointment_ic_btn_cancel_follow : C2694R.C2696drawable.appointment_ic_btn_follow);
            } else {
                drawable = null;
            }
            long j7 = j & 2113;
            if (j7 != 0) {
                if (userInfo != null) {
                    i6 = userInfo.getFreeWatches();
                } else {
                    i6 = 0;
                }
                if (i6 != -1) {
                    z4 = false;
                }
                if (j7 != 0) {
                    j |= z4 ? 131072 : 65536;
                }
                if (!z4) {
                    i = 8;
                    if ((j & 2305) == 0) {
                        str = UiUtils.num2str(userInfo != null ? userInfo.getUa() : 0);
                    } else {
                        str = null;
                    }
                    if ((j & 2561) == 0) {
                        str6 = UiUtils.num2str(userInfo != null ? userInfo.getBu() : 0);
                    } else {
                        str6 = null;
                    }
                    j4 = j & 2081;
                    if (j4 == 0) {
                        if (userInfo != null) {
                            z2 = userInfo.isOfficial();
                        } else {
                            z2 = false;
                        }
                        if (j4 != 0) {
                            j |= z2 ? PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE : PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED;
                        }
                        i3 = z2 ? 0 : 8;
                        str3 = str6;
                        str2 = str5;
                    } else {
                        str3 = str6;
                        str2 = str5;
                        i3 = 0;
                    }
                }
            }
            i = 0;
            if ((j & 2305) == 0) {
            }
            if ((j & 2561) == 0) {
            }
            j4 = j & 2081;
            if (j4 == 0) {
            }
        } else {
            str4 = null;
            drawable = null;
            str3 = null;
            str2 = null;
            str = null;
            i3 = 0;
            i2 = 0;
            i = 0;
            z = false;
        }
        long j8 = j & 2052;
        if (j8 != 0) {
            boolean safeUnbox = ViewDataBinding.safeUnbox(bool);
            if (j8 != 0) {
                if (safeUnbox) {
                    j3 = j | 32768;
                    j2 = PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE_ENABLED;
                } else {
                    j3 = j | 16384;
                    j2 = PlaybackStateCompat.ACTION_SET_REPEAT_MODE;
                }
                j = j3 | j2;
            }
            int i8 = safeUnbox ? 0 : 8;
            if (!safeUnbox) {
                i7 = 0;
            }
            i5 = i8;
            i4 = i7;
        } else {
            i5 = 0;
            i4 = 0;
        }
        long j9 = j & 2057;
        if (j9 != 0) {
            str7 = z ? "" : str2;
        }
        if ((j & 2048) != 0) {
            this.mboundView1.setOnClickListener(this.mCallback1);
            this.mboundView11.setOnClickListener(this.mCallback3);
            this.mboundView12.setOnClickListener(this.mCallback4);
            this.mboundView6.setOnClickListener(this.mCallback2);
        }
        if ((j & 2052) != 0) {
            this.mboundView1.setVisibility(i5);
            this.mboundView11.setVisibility(i4);
            this.mboundView12.setVisibility(i4);
            this.mboundView6.setVisibility(i5);
            this.mboundView7.setVisibility(i4);
        }
        if ((j & 3073) != 0) {
            ImageViewBindingAdapter.setImageDrawable(this.mboundView12, drawable);
        }
        if (j9 != 0) {
            TextViewBindingAdapter.setText(this.mboundView2, str7);
        }
        if ((j & 2065) != 0) {
            UserInfoActivity.setUserSexDetails(this.mboundView3, i2);
        }
        if ((2081 & j) != 0) {
            this.mboundView4.setVisibility(i3);
        }
        if ((2113 & j) != 0) {
            this.mboundView5.setVisibility(i);
        }
        if ((j & 2177) != 0) {
            TextViewBindingAdapter.setText(this.mboundView8, str4);
        }
        if ((2561 & j) != 0) {
            TextViewBindingAdapter.setText(this.tvMyFans, str3);
        }
        if ((j & 2305) != 0) {
            TextViewBindingAdapter.setText(this.tvMyFollow, str);
        }
    }

    @Override // com.grass.appointment.generated.callback.OnClickListener.Listener
    public final void _internalCallbackOnClick(int i, View view) {
        boolean z = false;
        if (i == 1) {
            UserInfoActivity.OnClick onClick = this.mClick;
            if (onClick != null) {
                z = true;
            }
            if (z) {
                onClick.showPopupWindow();
            }
        } else if (i == 2) {
            UserInfoActivity.OnClick onClick2 = this.mClick;
            if (onClick2 != null) {
                z = true;
            }
            if (z) {
                onClick2.editUserDetails();
            }
        } else if (i == 3) {
            UserInfoActivity.OnClick onClick3 = this.mClick;
            if (onClick3 != null) {
                z = true;
            }
            if (z) {
                onClick3.btnReward();
            }
        } else if (i == 4) {
            UserInfoActivity.OnClick onClick4 = this.mClick;
            if (onClick4 != null) {
                z = true;
            }
            if (z) {
                onClick4.btnFollowClick();
            }
        }
    }
}
